package com.aaa.utils;

import com.aaa.entity.AuthUser;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;

/**
 * @ClassName: AuthUserUtil
 * @Description: TODO
 * @Author: 86139
 * @Date: 2021/8/23 17:33
 * @Version:1.0
 **/
public class AuthUserUtil {
    public static Authentication AUTHENTICATION;
    public static AuthUser AUTHUSER;
    public void getAuthentication(){
        this.AUTHENTICATION=SecurityContextHolder.getContext().getAuthentication();
    }
    public void getAuthUser(){
        getAuthentication();
        this.AUTHUSER=(AuthUser)this.AUTHENTICATION.getPrincipal();
    }
}
